package com.fr.web.core;

import com.fr.base.CodeUtils;
import com.fr.base.FRContext;
import com.fr.base.Inter;
import com.fr.base.StringUtils;
import com.fr.base.core.BaseCoreUtils;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.core.FRCoreContext;
import com.fr.base.core.RSADecode;
import com.fr.base.core.json.JSONArray;
import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.core.json.JSONUtils;
import com.fr.base.core.util.TemplateUtils;
import com.fr.base.file.ConfigManager;
import com.fr.report.TemplateWorkBook;
import com.fr.report.core.ReportUtils;
import com.fr.report.parameter.Parameter;
import com.fr.report.script.core.FArray;
import com.fr.report.web.ToolBarManager;
import com.fr.util.Consts;
import com.fr.web.ParameterConsts;
import com.fr.web.Reportlet;
import com.fr.web.ReportletException;
import com.fr.web.ReportletRequest;
import com.fr.web.Repository;
import com.fr.web.ScheduleReportlet;
import com.fr.web.TemplateReportlet;
import com.fr.web.core.service.RTypeService;
import com.fr.web.platform.PlatformConstants.InnerParameter;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.util.URIUtil;

public class WebUtils
{
  public static final String FILE = "text";
  public static final String IMAGE = "image";
  public static final String OTHER = "other";
  public static final String SUCCESS = "success";
  public static final String FAILURE = "failure";
  private static String rights;

  public static String getHTTPRequestParameter(HttpServletRequest paramHttpServletRequest, String paramString)
  {
    Object localObject2;
    Object localObject1 = paramHttpServletRequest.getParameter(paramString);
    if (localObject1 == null)
      localObject1 = paramHttpServletRequest.getAttribute(paramString);
    if (localObject1 == null)
    {
      localObject2 = paramHttpServletRequest.getSession(false);
      if (localObject2 != null)
        localObject1 = ((HttpSession)localObject2).getAttribute(paramString);
    }
    if (localObject1 == null)
    {
      localObject2 = paramHttpServletRequest.getParameter("__parameters__");
      if (localObject2 instanceof String)
        try
        {
          localObject2 = decodeText((String)localObject2, paramHttpServletRequest);
          Map localMap = JSONUtils.jsonString2Map((String)localObject2);
          localObject1 = localMap.get(paramString);
        }
        catch (JSONException localJSONException)
        {
          localJSONException.printStackTrace();
        }
    }
    if (localObject1 == null)
    {
      paramString = CodeUtils.cjkEncode(paramString);
      localObject1 = paramHttpServletRequest.getParameter(paramString);
      if (localObject1 == null)
      {
        localObject1 = paramHttpServletRequest.getAttribute(paramString);
        if (localObject1 == null)
        {
          localObject2 = paramHttpServletRequest.getSession(false);
          if (localObject2 != null)
            localObject1 = ((HttpSession)localObject2).getAttribute(paramString);
        }
      }
    }
    return ((localObject1 == null) ? null : (String)(String)decodeText(String.valueOf(localObject1), paramHttpServletRequest));
  }

  public static String getReportTitleFromRequest(HttpServletRequest paramHttpServletRequest)
  {
    String str = getHTTPRequestParameter(paramHttpServletRequest, "reportletTitle");
    if (str == null)
      str = getHTTPRequestParameter(paramHttpServletRequest, "reportlet");
    if (str == null)
      str = getHTTPRequestParameter(paramHttpServletRequest, "reportlets");
    if (str == null)
      str = getHTTPRequestParameter(paramHttpServletRequest, "resultlet");
    return str;
  }

  public static String createServletURL(HttpServletRequest paramHttpServletRequest)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append(paramHttpServletRequest.getContextPath());
    localStringBuffer.append("/").append(FRContext.getConfigManager().getServletMapping());
    return localStringBuffer.toString();
  }

  public static PrintWriter createPrintWriter(HttpServletResponse paramHttpServletResponse)
    throws IOException
  {
    return createPrintWriter(paramHttpServletResponse, FRContext.getConfigManager().getServerCharset());
  }

  public static PrintWriter createPrintWriter(HttpServletResponse paramHttpServletResponse, String paramString)
    throws IOException
  {
    PrintWriter localPrintWriter;
    try
    {
      try
      {
        paramHttpServletResponse.setCharacterEncoding(paramString);
      }
      catch (Throwable localThrowable1)
      {
      }
      String str = null;
      try
      {
        str = paramHttpServletResponse.getContentType();
      }
      catch (Throwable localThrowable2)
      {
      }
      if (StringUtils.isBlank(str))
        paramHttpServletResponse.setContentType("text/html;charset=" + paramString);
      else if (str.indexOf("charset=") == -1)
        paramHttpServletResponse.setContentType(str + ";charset=" + paramString);
      localPrintWriter = new PrintWriter(new OutputStreamWriter(paramHttpServletResponse.getOutputStream(), paramString));
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      FRContext.getLogger().log(Level.INFO, localUnsupportedEncodingException.getMessage());
      localPrintWriter = new PrintWriter(paramHttpServletResponse.getOutputStream());
    }
    return localPrintWriter;
  }

  public static Map createTemplateMap(HttpServletRequest paramHttpServletRequest)
  {
    HashMap localHashMap = new HashMap();
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append(paramHttpServletRequest.getScheme());
    localStringBuffer.append("://");
    localStringBuffer.append(paramHttpServletRequest.getServerName());
    localStringBuffer.append(":");
    localStringBuffer.append(paramHttpServletRequest.getServerPort());
    localHashMap.put("servletURL", createServletURL(paramHttpServletRequest));
    localHashMap.put("serverURL", localStringBuffer);
    localHashMap.put("scheme", paramHttpServletRequest.getScheme());
    localHashMap.put("serverName", paramHttpServletRequest.getServerName());
    localHashMap.put("serverPort", Integer.toString(paramHttpServletRequest.getServerPort()));
    localHashMap.put("contextPath", paramHttpServletRequest.getContextPath());
    localHashMap.put("fr_right", getRights());
    localHashMap.put("company_project", getStatus());
    return localHashMap;
  }

  public static Map context4PageTpl(HttpServletRequest paramHttpServletRequest, SessionIDInfor paramSessionIDInfor)
  {
    return context4PolicyPaneTpl(paramHttpServletRequest, paramSessionIDInfor, null);
  }

  public static Map context4EditTpl(HttpServletRequest paramHttpServletRequest, SessionIDInfor paramSessionIDInfor)
  {
    Map localMap = context4CommonPaneTpl(paramHttpServletRequest, paramSessionIDInfor);
    Repository localRepository = new Repository(paramHttpServletRequest, paramSessionIDInfor);
    try
    {
      int i = paramSessionIDInfor.getReportCount();
      JSONArray localJSONArray = new JSONArray();
      for (int j = 0; j < i; ++j)
        localJSONArray.put(new JSONObject().put("title", paramSessionIDInfor.getReportName(j)));
      localMap.put("sheets", localJSONArray);
    }
    catch (Exception localException)
    {
      FRContext.getLogger().log(Level.WARNING, localException.getMessage(), localException);
    }
    try
    {
      localMap.put("param", RTypeService.config4ParameterPanel(localRepository, localRepository.isShowParameterPanel()));
    }
    catch (JSONException localJSONException)
    {
      FRContext.getLogger().log(Level.WARNING, localJSONException.getMessage(), localJSONException);
    }
    localMap.put("browserbg", HTMLWriterUtils.jsonBackground(ReportUtils.getBrowserBackgroundFromWorkBook(paramSessionIDInfor.getContextBook()), localRepository));
    return localMap;
  }

  public static Map context4CommonPaneTpl(HttpServletRequest paramHttpServletRequest, SessionIDInfor paramSessionIDInfor)
  {
    Map localMap = createTemplateMap(paramHttpServletRequest);
    if (paramSessionIDInfor == null)
      return localMap;
    localMap.put("charset", FRContext.getConfigManager().getServerCharset());
    localMap.put("sessionID", paramSessionIDInfor.getSessionID());
    localMap.put("reportlet_title", paramSessionIDInfor.getReportletTitle());
    localMap.put("csslink", paramSessionIDInfor.getCssLinks(localMap));
    localMap.put("jslink", paramSessionIDInfor.getJsLinks(localMap));
    return localMap;
  }

  public static Map context4PolicyPaneTpl(HttpServletRequest paramHttpServletRequest, SessionIDInfor paramSessionIDInfor, ShowWorkBookPolicy paramShowWorkBookPolicy)
  {
    Map localMap = context4CommonPaneTpl(paramHttpServletRequest, paramSessionIDInfor);
    paramShowWorkBookPolicy = (paramShowWorkBookPolicy == null) ? paramSessionIDInfor.getPolicy() : paramShowWorkBookPolicy;
    try
    {
      Repository localRepository = new Repository(paramHttpServletRequest, paramSessionIDInfor);
      if (localRepository.isNeedToolbar())
        localMap.put("script", TemplateUtils.renderTemplate("/com/fr/web/core/js/tpl_script.js", policyMap4Tpl(localRepository, paramShowWorkBookPolicy)));
      else
        localMap.put("script", TemplateUtils.renderTemplate("/com/fr/web/core/js/tpl_script_without_toolbar.js", policyMap4Tpl(localRepository, paramShowWorkBookPolicy)));
    }
    catch (IOException localIOException)
    {
      FRContext.getLogger().log(Level.WARNING, localIOException.getMessage(), localIOException);
    }
    return localMap;
  }

  public static Map policyMap4Tpl(Repository paramRepository, ShowWorkBookPolicy paramShowWorkBookPolicy)
  {
    Map localMap = paramRepository.checkoutTplContext();
    SessionIDInfor localSessionIDInfor = paramRepository.getSessionIDInfor();
    int i = (localSessionIDInfor.getParameterValue("__isdebug__") != null) ? 1 : 0;
    localMap.put("sessionID", localSessionIDInfor.getSessionID());
    if (paramShowWorkBookPolicy == null)
      return localMap;
    localMap.put("panel_type", paramShowWorkBookPolicy.panelType());
    JSONObject localJSONObject = null;
    try
    {
      localJSONObject = paramShowWorkBookPolicy.panelConfig(paramRepository);
    }
    catch (JSONException localJSONException1)
    {
      FRContext.getLogger().warning(localJSONException1.getMessage());
    }
    String str1 = null;
    try
    {
      if (i != 0)
        str1 = localJSONObject.toString(4);
      else
        str1 = localJSONObject.toString();
    }
    catch (JSONException localJSONException2)
    {
      str1 = localJSONObject.toString();
    }
    localMap.put("panel_config", str1);
    localMap.put("__pi__", String.valueOf(paramRepository.isShowParameterPanel()));
    StringWriter localStringWriter = new StringWriter();
    try
    {
      RTypeService.dealWithLoading(paramRepository, new PrintWriter(localStringWriter), paramShowWorkBookPolicy.panelType(), paramRepository.isShowParameterPanel());
    }
    catch (Exception localException)
    {
      FRContext.getLogger().log(Level.WARNING, localException.getMessage(), localException);
    }
    localMap.put("loading", localStringWriter.getBuffer().toString());
    if (paramRepository.isNeedToolbar())
    {
      ToolBarManager[] arrayOfToolBarManager = paramShowWorkBookPolicy.toolbarManagers(paramRepository);
      JSONArray localJSONArray = new JSONArray();
      for (int j = 0; (arrayOfToolBarManager != null) && (j < arrayOfToolBarManager.length); ++j)
        localJSONArray.put(arrayOfToolBarManager[j].toJSONConfig(paramRepository));
      String str2 = null;
      try
      {
        if (i != 0)
          str2 = localJSONArray.toString(4);
        else
          str2 = localJSONArray.toString();
      }
      catch (JSONException localJSONException3)
      {
        str2 = localJSONArray.toString();
      }
      localMap.put("toolbar_conf", str2);
    }
    return localMap;
  }

  private static String getRights()
  {
    if (rights == null)
    {
      byte[] arrayOfByte = FRCoreContext.getBytes();
      ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
      try
      {
        RSADecode.decode(arrayOfByte, localByteArrayOutputStream);
      }
      catch (Exception localException1)
      {
      }
      try
      {
        JSONObject localJSONObject = new JSONObject(new String(localByteArrayOutputStream.toByteArray(), "UTF-8"));
        String str = localJSONObject.getString("projectname");
        if ((localJSONObject.getLong("deadline") - Calendar.getInstance().getTimeInMillis() > 0L) && (localJSONObject.has("version")) && (ComparatorUtils.equals(Consts.VERSION, localJSONObject.getString("version"))) && (((localJSONObject.getLong("deadline") - Calendar.getInstance().getTimeInMillis() < new Long("3153600000").longValue()) || ((localJSONObject.has("macaddress")) && (BaseCoreUtils.getMacAddresses().contains(localJSONObject.getString("macaddress"))) && (localJSONObject.has("version"))))))
          rights = (StringUtils.isEmpty(str)) ? null : str;
      }
      catch (Exception localException2)
      {
      }
      if (rights == null)
        rights = "&nbsp;-&nbsp;<a href=\\'http://www.finereport.com\\' target=\\'_blank\\' style=\\'text-decoration:none\\'>FineReport Software</a>";
    }
    return rights;
  }

  private static String getStatus()
  {
    String str = getRights();
    if (str.equals("&nbsp;-&nbsp;<a href=\\'http://www.finereport.com\\' target=\\'_blank\\' style=\\'text-decoration:none\\'>FineReport Software</a>"))
      str = "FineReport";
    return str;
  }

  public static String decodeText(String paramString, HttpServletRequest paramHttpServletRequest)
  {
    if (paramString == null)
      return paramString;
    if (CodeUtils.isCJKEncoded(paramString))
      try
      {
        return CodeUtils.cjkDecode(paramString);
      }
      catch (Exception localException)
      {
      }
    return paramString;
  }

  public static void overflow(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, Collection paramCollection)
    throws IOException
  {
    Map localMap = createTemplateMap(paramHttpServletRequest);
    localMap.put("addresses", new FArray(paramCollection));
    TemplateUtils.dealWithTemplate("/com/fr/web/core/overflow.html", paramHttpServletResponse, localMap);
  }

  public static Map createSessionIDParameterMap(HttpServletRequest paramHttpServletRequest)
    throws Exception
  {
    HashMap localHashMap = new HashMap();
    Enumeration localEnumeration = paramHttpServletRequest.getParameterNames();
    while (true)
    {
      String str;
      while (true)
      {
        do
          while (true)
          {
            if (!(localEnumeration.hasMoreElements()))
              break label85;
            str = (String)localEnumeration.nextElement();
            if (str != null)
              break;
          }
        while (("reportlet".equalsIgnoreCase(str)) || ("format".equalsIgnoreCase(str)));
        if (!("op".equalsIgnoreCase(str)))
          break;
      }
      localHashMap.put(str, getHTTPRequestParameter(paramHttpServletRequest, str));
    }
    label85: return localHashMap;
  }

  public static Map dealWithExecuteParamMap(Map paramMap)
  {
    HashMap localHashMap = new HashMap();
    if (paramMap != null)
    {
      Object localObject;
      Iterator localIterator1 = paramMap.keySet().iterator();
      do
      {
        if (!(localIterator1.hasNext()))
          break label127;
        String str1 = (String)localIterator1.next();
        localObject = paramMap.get(str1);
      }
      while (!(localObject instanceof JSONObject));
      Map localMap = ((JSONObject)localObject).toMap();
      Iterator localIterator2 = localMap.keySet().iterator();
      while (true)
      {
        if (!(localIterator2.hasNext()));
        String str2 = (String)localIterator2.next();
        localHashMap.put(str2, localMap.get(str2));
      }
      label127: localHashMap.putAll(paramMap);
    }
    for (int i = 0; i < ParameterConsts.ALL.length; ++i)
      if (localHashMap.containsKey(ParameterConsts.ALL[i]))
        localHashMap.remove(ParameterConsts.ALL[i]);
    return localHashMap;
  }

  public static Map dealWithReportParameters(TemplateWorkBook paramTemplateWorkBook, Map paramMap)
  {
    HashMap localHashMap;
    Parameter[] arrayOfParameter = (paramTemplateWorkBook == null) ? null : paramTemplateWorkBook.getParameters();
    if (paramMap == null)
    {
      if ((arrayOfParameter == null) || (arrayOfParameter.length == 0))
        return Collections.EMPTY_MAP;
      localHashMap = new HashMap(arrayOfParameter.length);
    }
    else
    {
      int i;
      if ((arrayOfParameter == null) || (arrayOfParameter.length == 0))
      {
        localHashMap = new HashMap(paramMap.size());
      }
      else
      {
        localHashMap = new HashMap(arrayOfParameter.length);
        for (i = 0; i < arrayOfParameter.length; ++i)
          localHashMap.put(arrayOfParameter[i].getName(), arrayOfParameter[i].getValue());
      }
      Set localSet = paramMap.keySet();
      Iterator localIterator = localSet.iterator();
      while (localIterator.hasNext())
      {
        Object localObject = localIterator.next();
        localHashMap.put(localObject, paramMap.get(localObject));
      }
    }
    return localHashMap;
  }

  public static Reportlet initReportletFromPath(String paramString)
    throws Exception
  {
    Object localObject;
    if (("schedule".equals(paramString)) || ("schedulereport".equalsIgnoreCase(paramString)))
      localObject = new ScheduleReportlet();
    else if ((paramString.indexOf("/") != -1) || (paramString.indexOf("\\") != -1) || (paramString.toLowerCase().endsWith(".cpt")) || (paramString.toLowerCase().endsWith(".fwb")))
      localObject = new TemplateReportlet(paramString);
    else
      localObject = FRCoreContext.classForName(paramString).newInstance();
    if (localObject instanceof Reportlet)
      return ((Reportlet)localObject);
    return ((Reportlet)null);
  }

  public static TemplateWorkBook reportlet2ReportTemplate(String paramString, ReportletRequest paramReportletRequest)
    throws Exception
  {
    TemplateWorkBook localTemplateWorkBook;
    try
    {
      localTemplateWorkBook = initReportletFromPath(paramString).createReport(paramReportletRequest);
      if (localTemplateWorkBook == null)
        throw new ReportletException(Inter.getLocText("EX-Can_not_create_WorkBook_from_Reportlet"));
      return localTemplateWorkBook;
    }
    catch (ReportletException localReportletException)
    {
      throw new ReportletException("The Report in path:" + paramString + " " + Inter.getLocText("Error_To_Create_Report_From"), localReportletException);
    }
  }

  public static String getWebINFPath(ServletContext paramServletContext)
  {
    String str = paramServletContext.getRealPath("/");
    if (str == null)
      return null;
    if ((!(str.endsWith("/"))) && (!(str.endsWith("\\"))))
      str = str + File.separator;
    return str + "WEB-INF" + File.separator;
  }

  public static Map parameters4SessionIDInfor(HttpServletRequest paramHttpServletRequest)
  {
    Object localObject1;
    Object localObject2;
    HashMap localHashMap = new HashMap();
    if (paramHttpServletRequest == null)
      return localHashMap;
    HttpSession localHttpSession = paramHttpServletRequest.getSession(false);
    if (localHttpSession != null)
    {
      localEnumeration = localHttpSession.getAttributeNames();
      while (localEnumeration.hasMoreElements())
      {
        localObject1 = localEnumeration.nextElement();
        localObject2 = decodeText("" + localObject1, paramHttpServletRequest);
        localHashMap.put(localObject2, localHttpSession.getAttribute("" + localObject1));
      }
    }
    Enumeration localEnumeration = paramHttpServletRequest.getAttributeNames();
    if (localEnumeration.hasMoreElements())
    {
      label121: localObject1 = localEnumeration.nextElement();
      localObject2 = decodeText("" + localObject1, paramHttpServletRequest);
    }
    try
    {
      localHashMap.put(localObject2, getHTTPRequestParameter(paramHttpServletRequest, "" + localObject1));
    }
    catch (Exception localObject4)
    {
      label213: Object localObject3;
      break label121:
      localObject1 = paramHttpServletRequest.getParameterNames();
      if (((Enumeration)localObject1).hasMoreElements())
      {
        localObject2 = ((Enumeration)localObject1).nextElement();
        localObject3 = decodeText("" + localObject2, paramHttpServletRequest);
      }
      try
      {
        localHashMap.put(localObject3, getHTTPRequestParameter(paramHttpServletRequest, "" + localObject2));
      }
      catch (Exception str)
      {
        break label213:
        localObject2 = localHashMap.get("__parameters__");
        if (localObject2 instanceof String)
          try
          {
            localObject3 = JSONUtils.jsonString2Map((String)localObject2);
            localHashMap.putAll((Map)localObject3);
            localHashMap.remove("__parameters__");
          }
          catch (JSONException localJSONException)
          {
            FRContext.getLogger().log(Level.INFO, localJSONException.getMessage(), localJSONException);
          }
        for (int i = 0; i < PlatformConstants.InnerParameter.PRIVILEGE_AUTHENCATION_ALL.length; ++i)
          localHashMap.remove(PlatformConstants.InnerParameter.PRIVILEGE_AUTHENCATION_ALL[i]);
        if (localHttpSession != null)
        {
          Object localObject4 = localHttpSession.getAttribute("fr_authority");
          if (localObject4 != null)
            localHashMap.put("fr_authority", localObject4);
          String str = (String)localHttpSession.getAttribute("fr_username");
          if (str != null)
            localHashMap.put("fr_username", str);
        }
      }
    }
    return ((Map)(Map)(Map)localHashMap);
  }

  public static String getOriginalURL(HttpServletRequest paramHttpServletRequest)
  {
    if (paramHttpServletRequest == null)
      return "";
    StringBuffer localStringBuffer = paramHttpServletRequest.getRequestURL();
    Map localMap = paramHttpServletRequest.getParameterMap();
    Iterator localIterator = localMap.entrySet().iterator();
    int i = 1;
    while (localIterator.hasNext())
    {
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      if (i != 0)
      {
        localStringBuffer.append("?");
        i = 0;
      }
      else
      {
        localStringBuffer.append("&");
      }
      localStringBuffer.append(localEntry.getKey().toString());
      localStringBuffer.append("=");
      localStringBuffer.append(getHTTPRequestParameter(paramHttpServletRequest, localEntry.getKey().toString()));
    }
    return CodeUtils.cjkEncode(localStringBuffer.toString());
  }

  public static String doGet(String paramString1, String paramString2, String paramString3, boolean paramBoolean)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    HttpClient localHttpClient = new HttpClient();
    GetMethod localGetMethod = new GetMethod(paramString1);
    localGetMethod.getPath();
    try
    {
      if (StringUtils.isNotBlank(paramString2))
        localGetMethod.setQueryString(URIUtil.encodeQuery(paramString2));
      localHttpClient.executeMethod(localGetMethod);
      if (localGetMethod.getStatusCode() == 200)
      {
        BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localGetMethod.getResponseBodyAsStream(), paramString3));
        while (true)
        {
          String str;
          while (true)
          {
            if ((str = localBufferedReader.readLine()) == null)
              break label145;
            if (!(paramBoolean))
              break;
            localStringBuffer.append(str).append(System.getProperty("line.separator"));
          }
          localStringBuffer.append(str);
        }
        label145: localBufferedReader.close();
      }
    }
    catch (URIException localURIException)
    {
      FRContext.getLogger().log(Level.WARNING, localURIException.getMessage(), localURIException);
    }
    catch (IOException localIOException)
    {
      FRContext.getLogger().log(Level.WARNING, localIOException.getMessage(), localIOException);
    }
    finally
    {
      localGetMethod.releaseConnection();
    }
    return localStringBuffer.toString();
  }
}